<template>
	<view class="">
		<view class="list-content">
			<nav-bar title="签到" />
			<view class="list-search">
				<u-search placeholder="请输入名称搜索" v-model="queryParam.kaishixuexi" :showAction="false"
					@search="searchData" />
			</view>
			<view class="scrollCon padding-lr">
				<scroll-list :dataSource="dataSource" @reachBottom="reachBottom" :loadStatus="loadStatus">
					<template slot="scrollcon">
						<view class="list-item cu-card margin-bottom" v-for="(item,index) in dataSource" :key="index" @click="goDetail('/pages_permission/clockIn/add',item)">
							
							<view class="padding-tb">
								<view>
									<text>开始学习：</text>
									<text>{{item.kaishixuexi}}</text>
								</view>
								<view v-if="item.jieshuxuexi">
									<text>结束学习：</text>
									<text>{{item.jieshuxuexi}}</text>
								</view>
								<view>
									<text>打卡人：</text>
									<text>{{item.dakaren}}</text>
								</view>
							</view>
						</view>
					</template>
				</scroll-list>
			</view>
			<view class="padding-bottom padding-lr">
				<u-button type="primary" text="签到" @click="addClick" />
			</view>
		</view>
	</view>
</template>

<script>
	import ScrollList from '@/components/scrollLists.vue';
	import {
		ListMixin
	} from '@/common/mixins/mixins.js'
	export default {
		name: 'ClockInList',
		desc: '签到',
		mixins: [ListMixin],
		components: {
			ScrollList
		},
		data() {
			return {
				userInfo: this.$store.state.vuex_user, //用户信息
				
				urlapi: {
					list: '/qiandaodaka/page'
				},
			}
		},
		onShow() {
			this.initDatas()
		},
		methods: {
			//初始化数据
			initDatas() {
				this.dataSource = []
				this.ipagination = {
					page: 1, //当前页
					size: 10, //每页多少条
					total: 0, //总条数
				}
				this.queryParam={
					//增加当前学生学号
					dakaren:this.userInfo.xuehao
				}
				this.loadData()
			},
			searchData(e) {
				this.queryParam.kaishixuexi = e
				this.initDatas()
			},
			addClick() {
				this.$uniRouter.navigateTo({
					url: '/pages_permission/clockIn/add'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>


</style>